package com.chinacoal.microservice;


import com.chinacoal.microservice.fallback.FeeRateTemplateClientFallback;
import com.chinacoal.microservice.pojo.CcmsSmartleasingRoom;
import com.chinacoal.microservice.pojo.CcmsSmartleasingTaxRateTemplate;
import com.chinacoal.microservice.util.QueryCriteria;
import com.chinacoal.microservice.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 费用税率模板-对外开放的接口类
 * @date 2020-12-05 14：58
 */
@FeignClient(name = "${spring.application.name}",fallback = FeeRateTemplateClientFallback.class,configuration = FeignAutoConfiguration.class)
@Api(tags = {"费用税率模板"})
public interface FeeRateTemplateClient {

    /**
     * @Description: 查询所有的费用税率模板信息(带分页)
     * @author zhuliang
     * @date 2020/12/5 15:15
     */
    @ApiOperation(value = "查询所有的费用税率模板信息(带分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "queryCriteria", value = "查询条件", required = true, dataType = "QueryCriteria")
    })
    @PostMapping("smartleasing/feeRateTemplate/getAllByPage")
    public Result<List<CcmsSmartleasingTaxRateTemplate>> getAllByPage(@RequestBody QueryCriteria queryCriteria);

    /**
     * @Description: 条件查询所有的费用税率模板信息(带分页)
     * @author zhuliang
     * @date 2020/12/5 15:28
     */
    @ApiOperation(value = "条件查询所有的费用税率模板信息(带分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "queryCriteria", value = "查询条件", required = true, dataType = "QueryCriteria")
    })
    @PostMapping("smartleasing/feeRateTemplate/getAllByCondition")
    public Result<List<CcmsSmartleasingTaxRateTemplate>> getAllByCondition(@RequestBody QueryCriteria queryCriteria);

    /**
     * @Description: 查询相关房间信息
     * @author zhuliang
     * @date 2020/12/5 16:00
     */
    @ApiOperation(value = "查询相关房间信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "pkTaxRateTemplateId", value = "税率模板id", required = true, dataType = "String")
    })
    @GetMapping("smartleasing/feeRateTemplate/echoAssociatedRoom/{pkTaxRateTemplateId}")
    public Result<List<CcmsSmartleasingRoom>> echoAssociatedRoom(@PathVariable(value = "pkTaxRateTemplateId") String pkTaxRateTemplateId);

    /**
     * @Description: 添加费用税率模板消息
     * @author zhuliang
     * @date 2020/12/5 16:17
     */
    @ApiOperation(value = "添加费用税率模板信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "taxRateTemplate", value = "税率模板实体类", required = true, dataType = "CcmsSmartleasingTaxRateTemplate"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @PostMapping("smartleasing/feeRateTemplate/addFeeRateTemplate")
    public Result addFeeRateTemplate(@RequestBody CcmsSmartleasingTaxRateTemplate taxRateTemplate,
                                     @RequestHeader("token") String token);

    /**
     * @Description: 根据税率模板id查询模板消息
     * @author zhuliang
     * @date 2020/12/5 16:23
     */
    @ApiOperation(value = "根据税率模板id查询模板信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "pkTaxRateTemplateId", value = "税率模板id", required = true, dataType = "String")
    })
    @GetMapping("smartleasing/feeRateTemplate/getTemplateById/{pkTaxRateTemplateId}")
    public Result<CcmsSmartleasingTaxRateTemplate> getTemplateById(@PathVariable(value = "pkTaxRateTemplateId") String pkTaxRateTemplateId);

    /**
     * @Description: 修改费用税率模板消息
     * @author zhuliang
     * @date 2020/12/5 16:29
     */
    @ApiOperation(value = "修改费用税率模板信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "taxRateTemplate", value = "税率模板实体类", required = true, dataType = "CcmsSmartleasingTaxRateTemplate"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @PutMapping("smartleasing/feeRateTemplate/updateTemplate")
    public Result updateTemplate(@RequestBody CcmsSmartleasingTaxRateTemplate taxRateTemplate, @RequestHeader("token") String token);

    /**
     * @Description: 根据税率模板id删除模板消息
     * @author zhuliang
     * @date 2020/12/5 16:50
     */
    @ApiOperation(value = "根据税率模板id删除模板信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "pkTaxRateTemplateId", value = "税率模板id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @DeleteMapping("smartleasing/feeRateTemplate/deleteTemplate/{pkTaxRateTemplateId}")
    public Result deleteTemplate(@PathVariable(value = "pkTaxRateTemplateId") String pkTaxRateTemplateId, @RequestHeader("token") String token);
}
